package com.wiscamp.ninechapters.problems.application.assemblers;

import com.wiscamp.ninechapters.problems.application.dto.commands.sets.*;
import com.wiscamp.ninechapters.problems.application.dto.vo.sets.KnowledgePointRuleVO;
import com.wiscamp.ninechapters.problems.application.dto.vo.sets.ProblemTypeRuleVO;
import com.wiscamp.ninechapters.problems.application.dto.vo.sets.RegroupRuleVO;
import com.wiscamp.ninechapters.problems.application.dto.vo.sets.TagRuleVO;
import com.wiscamp.ninechapters.problems.domain.models.sets.KnowledgePointRule;
import com.wiscamp.ninechapters.problems.domain.models.sets.ProblemTypeRule;
import com.wiscamp.ninechapters.problems.domain.models.sets.RegroupRule;
import com.wiscamp.ninechapters.problems.domain.models.sets.TagRule;
import org.mapstruct.Mapper;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface RegroupRuleAssembler {
    RegroupRuleAssembler Instance = Mappers.getMapper(RegroupRuleAssembler.class);

    // region regroup rule
    RegroupRuleVO toRegroupRuleVO(RegroupRule entity);

    RegroupRule fromCreateCommand(CreateRegroupRuleCommand command);

    RegroupRule fromUpdateCommand(UpdateRegroupRuleCommand command);
    // endregion


    // region tag rule
    TagRuleVO toTagRuleVO(TagRule entity);
    // endregion

    // region problem type rule

    ProblemTypeRuleVO toProblemTypeRuleVO(ProblemTypeRule entity);
    // endregion

    // region knowledge point rule
    KnowledgePointRuleVO toKnowledgePointRuleVO(KnowledgePointRule entity);
    // endregion



    TagRule toTagRule(CreateTagRuleDto dto);

    TagRule toTagRule(UpdateTagRuleDto dto);


    ProblemTypeRule toProblemTypeRule(CreateProblemTypeRuleDto dto);

    ProblemTypeRule toProblemTypeRule(UpdateProblemTypeRuleDto dto);


    KnowledgePointRule toKnowledgePointRule(CreateKnowledgePointRuleDto dto);
    
    KnowledgePointRule toKnowledgePointRule(UpdateKnowledgePointRuleDto dto);
}
